package io.geekidea.boot.framework.interceptor;

import com.github.pagehelper.PageHelper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.method.HandlerMethod;


/**
 * @author geekidea
 * @date 2022/10/12
 **/
@Slf4j
public class PageHelperClearInterceptor extends BaseMethodInterceptor {

    @Override
    protected boolean preHandleMethod(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) {
        try {
            PageHelper.clearPage();
        } catch (Exception e) {
            log.error("PageHelperClearInterceptor preHandleMethod error", e);
        }
        return true;
    }

}
